<!DOCTYPE html>
<#import "/spring.ftl" as spring />
<html lang="en">
<head>
    <link rel="stylesheet" type="text/css" href="<@spring.url '/admin/bootstrap3/bootstrap.min.css'/>">
    <link rel="stylesheet" type="text/css" href="<@spring.url '/admin/bootstrap3/bootstrap-theme.min.css'/>">
    <link rel="stylesheet" type="text/css" href="<@spring.url '/admin/bootstrap3/bootstrapTable/bootstrap-table.min.css'/>">
    <link rel="stylesheet" type="text/css" href="<@spring.url '/admin/css/mycss.css'/>">

    <title>TPO</title>
    <style>
        .message{
            padding: 5px 0 ;
        }
        .message p{
            padding:5px;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">TPO Admin</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="<@spring.url '/admin/category/list'/>">分类</a></li>
                <li class="active"><a href="<@spring.url '/admin/article/list'/>">文章</a></li>
                <li><a href="<@spring.url '/admin/user'/>">用户</a></li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>

<div class="container">
    <h4>新增分类</h4>
    <div id="message" class="message">
        <#if successMessage?default('') != ''>
            <p class="bg-success">${successMessage}</p>
        </#if>
        <#if errorMessage?default('') != ''>
            <p class="bg-danger">${errorMessage}</p>
        </#if>
    </div>
    <form class="form-horizontal" method="post" action="/tpo/admin/category/addSave" enctype="multipart/form-data">
        <div class="form-group">
            <label class="col-sm-2 control-label">name_cn</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="name_cn" name="name_cn" value="${category.name_cn!}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">name_en</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="name_en" name="name_en" value="${category.name_en!}">
            </div>
        </div>
        <div class="form-group">
            <label for="coverFile">封面图片</label>
            <img src="${category.cover_url!}" height="50px">
            <input type="file" class="form-control" id="coverFile" name="coverFile" >
        </div>
        <!--<div class="form-group">-->
            <!--<label for="videoFile">视频 [原视频URL：${category.video_url!}]</label>-->
            <!--<input type="file" class="form-control" id="videoFile" name="videoFile" >-->
        <!--</div>-->

        <button type="submit" class="btn btn-primary btn-lg"> 保 存 </button>
    </form>
</div>

<script src="<@spring.url '/admin/js/jquery-3.2.1.min.js'/>"></script>
<script src="<@spring.url '/admin/js/popper.min.js'/>"></script>
<script src="<@spring.url '/admin/bootstrap3/bootstrapTable/bootstrap-table.js'/>"></script>
<script src="<@spring.url '/admin/bootstrap3/bootstrapTable/bootstrap-table-zh-CN.min.js'/>"></script>
<script>
</script>
</body>
</html>